package org.fuys.coder.infrastructure.repository;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.fuys.coder.domain.audit.respository.IAuditFailedRepository;
import org.fuys.coder.infrastructure.dao.AuditFailedMapper;
import org.fuys.coder.infrastructure.model.po.AuditFailed;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @projectName: fuys-low-coder
 * @package: org.fuys.coder.infrastructure.repository
 * @className: AuditFailedRepositoryImpl
 * @author: WangJing
 * @description: 审核失败仓储
 * @date: 2024/6/30 22:39
 * @version: 1.0
 */
@Service
public class AuditFailedRepositoryImpl extends ServiceImpl<AuditFailedMapper, AuditFailed>
        implements IAuditFailedRepository {

    @Resource
    private AuditFailedMapper auditFailedMapper;

    @Override
    public void saveRecord(Integer typeId, Long otherId, Integer userId, String reason) {
        AuditFailed auditFailed=new AuditFailed();
        auditFailed.setBeAuditedId(otherId);
        auditFailed.setTypeId(typeId);
        auditFailed.setUserId(userId);
        auditFailed.setReason(reason);
        auditFailedMapper.insert(auditFailed);
    }
}
